using System;
using EPiServer.Common.Configuration.Entity;
using EPiServer.Common.Data;

namespace EPiAbstractions.Common.Data
{
    public class EntityProviderHandlerFacade : IEntityProviderHandlerFacade
    {
        private static EntityProviderHandlerFacade _instance;

        public static EntityProviderHandlerFacade Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new EntityProviderHandlerFacade();

                return _instance;
            }

            set { _instance = value; }
        }

        #region IEntityProviderHandlerFacade Members

        public virtual IEntityProvider GetEntityProvider(Type entityType)
        {
            return EntityProviderHandler.GetEntityProvider(entityType);
        }

        public virtual void LoadEntityProviders(EntityElement es)
        {
            EntityProviderHandler.LoadEntityProviders(es);
        }

        #endregion
    }
}